Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tanstack useQuery, useMutation docs, deprecated custom useQuery #91

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

amjithtitus09
Copy link
Contributor

Update Data Fetching Documentation for TanStack Query Migration

Description

Updated the data fetching documentation to reflect our migration from custom hooks to TanStack Query. The new documentation provides clear examples and best practices for using TanStack Query in CARE.

Changes

  • Replaced documentation for deprecated useQuery and useMutation hooks
  • Added examples showing how to use TanStack Query with our existing route definitions
  • Included practical examples for common use cases:
    • Basic data fetching
    • Query parameters
    • Path parameters
    • Mutations (create/update/delete)
    • Dependent queries
  • Added direct links to relevant TanStack Query documentation sections
  • Noted deprecation of legacy hooks

Additional Notes

  • Documentation maintains compatibility with our existing route definition pattern
  • Added links to TanStack docs for advanced features to avoid duplicating their documentation

Migration Guide

For teams migrating from the old hooks:

  1. Replace useTanStackQueryInstead with useQuery from '@tanstack/react-query'
  2. Replace useDeprecatedMutation with useMutation from '@tanstack/react-query'
  3. Follow the examples in the updated documentation for proper query key structure

Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for docs-ohc ready!

Name Link
🔨 Latest commit 9846d22
🔍 Latest deploy log https://app.netlify.com/sites/docs-ohc/deploys/675c475a990a380008a6c9e7
😎 Deploy Preview https://deploy-preview-91--docs-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, can we drop the lockfile changes if nothing was upgraded?

@gigincg gigincg merged commit 7e69419 into ohcnetwork:master Dec 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants